package com.zhaojonhy.zhaopangwb.bean;

import java.io.Serializable;

/**
 * Created by Administrator on 2016/9/20.
 */

public  class PicUrls extends BaseEntity {

    //中等质量图片url前缀;
    private static final String BMIDDLE_URL = "http://ww3.sinaimg.cn/bmiddle/" ;
    private static final String ORIGINAL_URL = "http://ww3.sinaimg.cn/large/" ;
    private String thumbnail_pic;
    private String bmiddle_pic;
    private String original_pic;

    //是否需要显示原图的标识位
    private boolean showOriImg ;

    /**
     *  从缩略图url中截取末尾的图片id，用于和拼接成其他质量图片的url
     */
    public String getUrlId(){
        int index = thumbnail_pic.lastIndexOf("/")+1 ;
        return thumbnail_pic.substring(index) ;
    }

    public String getThumbnail_pic() {
        return thumbnail_pic;
    }

    public void setThumbnail_pic(String thumbnail_pic) {
        this.thumbnail_pic = thumbnail_pic;
    }

    public String getBmiddle_pic() {
        return BMIDDLE_URL+getUrlId() ;
    }

    public void setBmiddle_pic(String bmiddle_pic) {
        this.bmiddle_pic = bmiddle_pic;
    }

    public String getOriginal_pic() {
        return ORIGINAL_URL+getUrlId() ;
    }

    public void setOriginal_pic(String original_pic) {
        this.original_pic = original_pic;
    }

    public boolean isShowOriImg() {
        return showOriImg;
    }

    public void setShowOriImg(boolean showOriImg) {
        this.showOriImg = showOriImg;
    }
}